package com.medusa.aps.business.config;

import com.medusa.aps.business.properties.ApsProperties;
import com.medusa.aps.business.global.config.helper.ExecutorHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executor;

/**
 * @author: xianhui.yu
 **/
@Configuration
public class ThreadPoolConfig {

    @Bean("taskPoolExecutor")
    public Executor taskPoolExecutor(ApsProperties apsProperties) {
        return ExecutorHelper.toTaskExecutor(apsProperties.getThreadPool());
    }
}
